<?php

/**
 *  用户订阅
*/

namespace app\api\controller;

use app\api\service\Login as ServiceLogin;
use app\facade\Basic;
use think\Request;
use app\api\service\Subscribe as ServiceSubscribe;

class Subscribe extends BaseController
{

    /**
     *  邮箱订阅
    */
    public function email(Request $request)
    {
        $param['email'] = $request->param('email',null);
        $param['ip'] = $request->ip();

        /* 验证 */
        $this->validateData($param,'Subscribe.email');

        /* 登录操作 */

        $ServiceSubscribe = new ServiceSubscribe();
        $result = $ServiceSubscribe->email($param);
        return Basic::json($result);
    }

}
